The cerebral cortex is a computational machine. Despite intense investigation, many of its basic operating principles remain unknown, and its language ? patterns of action potentials in space and time ? is still largely uninterpretable. Thus to understand brain function, it is critical that we establish the fundamental logic of how cortical circuits encode sensory stimuli to generate perceptions and guide behavior. Just as deciphering the genetic code revolutionized our understanding of basic biology and our ability to treat genetic disorders, deciphering the neural code will dramatically enhance our understanding of neural function and our ability to treat neurological disease. Existing approaches, however, are not sufficient to adequately address this problem. Therefore the goal of this proposal is to develop new experimental paradigms to help decipher the code and identify the mechanisms by which cortical circuits generate perceptions. We will leverage structured light microscopy1 and optogenetic tools2,3 to design new approaches that will allow us to control the spatiotemporal activity of cortical neurons in the intact brain with unprecedented precision. In the first approach we will bi-directionally control the activity of individual cortical layers and columns ? the two major subdivisions of the cortex ? by combining a digital micromirror device with cell-type specific targeting of optogenetic neural activators and silencers. This will allow us to determine how these subdivisions cooperate to extract basic features of sensory stimuli that are central to perception. In the second approach we will control the activity of highly specific local ensembles of cortical neurons at single cell resolution using two-photon structured light microscopy. This will allow us to assess how cortical circuits generate perceptions through precise spatiotemporal patterns of neural activity. Ultimately, we envision that the application of these techniques will help us interpret the neural codes for perception. Not only will this lead to a much more mechanistic understanding of cortical function, but it should help us understand the causes of neurological disorders and aid in the design of more effective neural prostheses.